package cn.syncrond.tcm.util;

/**
 * @Description: 反射类
 * @author meepai
 * @date 2016-11-21
 */
public class Reflections {

	/**
	 * 使用默认的构造函数，构造期望的对象
	 * @param className
	 * @param expectClass
	 * @return
	 */
	public static <T> T newInstance(String className, Class<T> expectClass){
		try {
			Class<?> clazz = Class.forName(className);
			return clazz.asSubclass(expectClass).newInstance();
		} catch (ClassNotFoundException e) {
		} catch (InstantiationException e) {
		} catch (IllegalAccessException e) {
		}
		return null;
	}
}
